import request from '@/config/axios'

// 资产报修记录 VO
export interface AssetRepairVO {
  id: number // 报修记录ID
  assetName: string // 资产名称
  assetCategory: string // 资产分类
  assetBrand: string // 资产品牌
  model: string // 资产型号
  repairDate: Date // 维修日期
  repairCost: number // 维修费用
  repairReason: string // 维修原因
  userId: number // 跟进人
  userName: string,
  recordTime: Date // 记录时间
}

// 资产报修记录 API
export const AssetRepairApi = {
  // 查询资产报修记录分页
  getAssetRepairPage: async (params: any) => {
    return await request.get({ url: `/oa/asset-repair/page`, params })
  },

  // 查询资产报修记录详情
  getAssetRepair: async (id: number) => {
    return await request.get({ url: `/oa/asset-repair/get?id=` + id })
  },

  // 新增资产报修记录
  createAssetRepair: async (data: AssetRepairVO) => {
    return await request.post({ url: `/oa/asset-repair/create`, data })
  },

  // 修改资产报修记录
  updateAssetRepair: async (data: AssetRepairVO) => {
    return await request.put({ url: `/oa/asset-repair/update`, data })
  },

  // 删除资产报修记录
  deleteAssetRepair: async (id: number) => {
    return await request.delete({ url: `/oa/asset-repair/delete?id=` + id })
  },

  // 导出资产报修记录 Excel
  exportAssetRepair: async (params) => {
    return await request.download({ url: `/oa/asset-repair/export-excel`, params })
  }
}